package com.exercise;

import java.util.HashSet;
import java.util.Set;

public class exercise02 {
    public static void main(String[] args) {
        Student stu1 = new Student("张三","男",20);
        Student stu2 = new Student("李四","女",21);
        Student stu3 = new Student("张三","男",20);

        Set<Student> hashSet = new HashSet<Student>();
        hashSet.add(stu1);
        hashSet.add(stu2);
        hashSet.add(stu3);
        for(Student stu : hashSet){
            System.out.println("姓名：" + stu.getName() + "，性别：" + stu.getSex() + "，年龄：" + stu.getAge());
        }
    }
}
